//
//  DSPNavigationController.swift
//  SWweibo
//
//  Created by 杜守鹏 on 15/12/27.
//  Copyright © 2015年 杜守鹏. All rights reserved.
//

import UIKit

class DSPNavigationController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()
   navigationController?.navigationBar.shadowImage = UIImage(named: "")
}

    override func pushViewController(viewController: UIViewController, animated: Bool) {
        
        if childViewControllers.count > 0{
            viewController.hidesBottomBarWhenPushed = true
            if childViewControllers.count>1{
            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(imageName: "navigationbar_back_withtext", title: "返回", target: self, action: "pop")
                
            }
        }
        
        super.pushViewController(viewController, animated: animated)
    }
    
    func pop(){
        self.popViewControllerAnimated(true)
    }
}

